String clazzTpl({package}) => """
import 'utils/print_util.dart';
import 'route/main.route.dart';
import 'l10n/generated/l10n.dart';
import 'package:xanno/xanno.dart';
import 'debug/app_debug_model.dart';
import 'package:flutter/material.dart';
import 'widget/base_store_container.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

@GApi()
@GAssets(path: 'assets')
@GFormatter(showTotalCodeLines: true)
//@GIconfont(url: '//at.alicdn.com/t/font_xxxx_g48kd9v3h54.js')
class App extends StatefulWidget {
  final String route;
  final Store<ReduxState> store;

  const App({Key? key, required this.store, required this.route})
      : super(key: key);

  @override
  State<App> createState() => _AppState();
}

class _AppState extends State<App> {
  @override
  Widget build(BuildContext context) {
    return StoreProvider<ReduxState>(
      store: widget.store,
      child: BaseStoreContainer(
        builder: (context, theme, state, dispatch) {
          return MaterialApp(
            localizationsDelegates: const [
              S.delegate,
              GlobalMaterialLocalizations.delegate,
              GlobalWidgetsLocalizations.delegate,
              GlobalCupertinoLocalizations.delegate,
            ],
            supportedLocales: S.delegate.supportedLocales,
            theme: ThemeData(
              platform: TargetPlatform.iOS,
              highlightColor: Colors.transparent,
              splashColor: Colors.transparent,
            ),
            darkTheme: ThemeData(
              platform: TargetPlatform.iOS,
              highlightColor: Colors.transparent,
              splashColor: Colors.transparent,
            ),
            themeMode: theme.themeMode,
            navigatorKey: globalNavigatorKey,
            debugShowCheckedModeBanner: context.isOn(AppDebugKey.debugBanner),
            initialRoute: RouteConstant.MainPage,
            routes: routes(context),
            builder: (context, widget) {
              return MediaQuery(
                data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
                child: widget!,
              );
            },
            navigatorObservers: [
              NavObserver(),
            ],
          );
        },
      ),
    );
  }
}

class NavObserver extends NavigatorObserver {
  @override
  void didPush(Route route, Route? previousRoute) {
    logDebugPrint('push \${route.settings.name}');
  }

  @override
  void didPop(Route route, Route? previousRoute) {
    logDebugPrint('pop \${route.settings.name}');
  }

  @override
  void didReplace({Route? newRoute, Route? oldRoute}) {
    logDebugPrint('replace \${newRoute!.settings.name}');
  }
}
""";
